package com.akcome.apollo.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import com.akcome.apollo.domain.VStatsWorkersHour;
import com.akcome.apollo.dto.WorkerScore;

/**
 * VIEWRepository接口
 *
 * @author wn
 * @version $v: 1.0.0, $time:2017-12-26 08:49:00 Exp $
 */
public interface VStatsWorkersHourRepository extends JpaRepository<VStatsWorkersHour,Long>,JpaSpecificationExecutor<VStatsWorkersHour> {

	@Query(value="select new com.akcome.apollo.dto.WorkerScore(w.workerName,h.hour,h.accept) from VStatsWorkersHour h,VMiningWorkers w where h.puid =w.puid and h.cointype = w.cointype and h.workerId=w.workerId and h.puid=?1 and h.hour BETWEEN ?2 and ?3 order by h.hour")
	List<WorkerScore> findSpeedByPuid(Long puid,String beginDate,String endDate);
}
